#include<stdio.h>
#include<stdlib.h>
typedef struct {
    int x;
    int y;
} POINT;
POINT zero;
void input(POINT *q) {
    scanf("%d%d",&q->x,&q->y);
}
void output(POINT *q) {
    printf("(%d,%d)\n",q->x,q->y);
}
double distance(POINT*p,POINT*q){
    double dx=p->x - q->x;
    double dy=p->y - q->y;
    return sqrt(dx*dx+dy*dy);
}
int inc(const void*a,const void*b){
    POINT*pa=(POINT*)(a),*pb=(POINT*)(b);
    double dd=distance(pa,&zero)-distance(pb,&zero);
    if(dd>0)
        return 1;
    if(dd<0)
        return -1;
    return 0;

}
int main() {
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    POINT p[10];
    int i;
    for(i=0;i<10;i++)
        input(p+i);
    qsort(p,10,sizeof(POINT),inc);
    for(i=0;i<10;i++)
        output(p+i);
    return 0;
}
